<%@page import="cn.com.entity.Departments"%>
<%@page import="cn.com.dao.DepartmentsDao"%>
<%@page import="cn.com.entity.Doctor"%>
<%@page import="java.util.List"%>
<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>管理医生</title>
<style type="text/css">
#main{
	margin-top: 5%;
	color: #03C;
}

</style>
<script type="text/javascript">
function shanchu(){
	var queren=confirm("确认要删除吗");
	if(queren!=true){
		return false;
	}
}

</script>

</head>
<body>

<div id="main">
<form action="" method="post">
<h2 align="center">医生管理</h2>
<center>${doctormsg }</center>
<table width="100%" border="1">


	<tr>
		<td>医生用户名</td>
		<td>医生真实姓名</td>
		<td>性别</td>
		<td>联系方式</td>
		<td>工作时间</td>
		<td>医生简介</td>
		<td>医生职称</td>
		<td>所属科室</td>
		<td>修改</td>
		<td>删除</td>
	</tr>
<%
if(session.getAttribute("alldoctorlist")!=null){
	List<Doctor> doclist=(List<Doctor>)session.getAttribute("alldoctorlist");
	for(int i=0;i<doclist.size();i++){
	Doctor d=doclist.get(i);
	int departid=d.getDepartmentsid();
DepartmentsDao dd=new DepartmentsDao();
Departments depart=dd.selectOneDepartments(departid);
%>	
	<tr>
		<td><%=d.getDoctorname()%></td>
		<td><%=d.getDoctorrealname() %></td>
		<td><%=d.getDoctorsex() %></td>
		<td><%=d.getDoctorphone() %></td>
		<td><%=d.getDoctorworktime() %></td>
		<td><%=d.getDoctorprofile() %></td>
		<td><%=d.getDoctordesignation() %></td>
		<td><%=depart.getDepartmentsname() %></td>
		<td><a href="selonedoctoraction?doctor.doctorid=<%=d.getDoctorid()%>">修改</a></td>
		<td><a href="deletedoctoraction?doctor.doctorid=<%=d.getDoctorid()%>" onclick="return shanchu()" >删除</a></td>
	</tr>
<%} 
}%>	
</table>

</form>
</div>
</body>
</html>